﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using HHo_Model;
using HHo_Negocio;
using System.Collections.Generic;

public partial class mantenimientos_wfManConsultaOrigen : System.Web.UI.Page
{
    E_Origen eOrigen;
    GestorOrigen oGestOrigen;
    protected void Page_Load(object sender, EventArgs e)
    {
        this.ClientScript.GetPostBackEventReference(this, string.Empty);
        if (Request.Form["__eventtarget"] == "ActualizarGrid")
        {
            gvMante.DataSource = PoblarGrid();
            gvMante.DataBind();
        }
    }

    private List<E_Origen> PoblarGrid()
    {
        eOrigen = new E_Origen();
        oGestOrigen = new GestorOrigen();

        eOrigen.Codigo = txtCodigo.Text;
        eOrigen.Descripcion = txtDesc.Text;

        return oGestOrigen.Man_ConsultarOrigen(eOrigen);
    }
    protected void imgConsultar_Click(object sender, ImageClickEventArgs e)
    {
        gvMante.DataSource = PoblarGrid();
        gvMante.DataBind();
    }
}
